Skip to content

Stand alone operations for Nexus#2872

Open
Evanthx wants to merge 47 commits into
masterfrom
sano
Open

Stand alone operations for Nexus#2872
Evanthx wants to merge 47 commits into
masterfrom
sano

Conversation

@Evanthx

@Evanthx Evanthx commented May 7, 2026

Copy link
Copy Markdown
Contributor

What was changed

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@Evanthx Evanthx requested a review from a team as a code owner May 7, 2026 22:53
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClient.java
* type binding to an {@link UntypedNexusClientHandle} (returned by {@link
* NexusClient#getHandle(String)}) by calling one of the {@link #fromUntyped} factories.
*/
public interface NexusClientHandle<R> extends UntypedNexusClientHandle {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public interface NexusClientHandle<R> extends UntypedNexusClientHandle {
public interface NexusOperationHandle<R> extends UntypedNexusOperationHandle {

Please keep consistent naming with other Handles like https://github.com/temporalio/sdk-java/blob/master/temporal-sdk/src/main/java/io/temporal/client/ActivityHandle.java

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nexus doc had "NexusOperationHandle". I didn't use that name as there was already a NexusOperationHandle class and I didn't want to duplicate it. Even if in a different package, that just seemed confusing.

The reason I went to NexusClient in a lot of class names was to avoid naming collisions like that - again, even if in different packages it seemed confusing, and I wanted some form of consistency. So I named this NexusClientHandle to show that it was linked to the other NexusClient classes.

That being said, I do want to be consistent, but might have to check in with you and talk this one out. Maybe we can make these NexusOperationExecutionHandle and UntypedNexusOperationExecutionHandle, but then we lose the link to the other NexusClient classes - though would we use these for all Nexus operations so maybe we don't need such a link?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to NexusOperationHandle as per conversation - we feel that the names being in different packages that have different use cases which should never be mixed should be sufficient to avoid confusion, especially as the user will get this returned to them and won't be creating these classes.

Leaving this conversation unresolved to make sure the SDK team sees it and can weigh in!

Comment thread temporal-sdk/src/main/java/io/temporal/client/UntypedNexusClientHandle.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/UntypedNexusClientHandle.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/UntypedNexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/UntypedNexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClientOperationOptions.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClientImpl.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClientImpl.java Outdated
Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusServiceClientTest.java Outdated
Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusClientHandleTest.java Outdated
Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusClientTest.java Outdated
Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusClientHandleTest.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClientOperationOptions.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClientOperationOptions.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
@Quinn-With-Two-Ns

Copy link
Copy Markdown
Contributor

Reviewed most of the public API, didn't get to into the tests or implementation for now since some stuff will likely change.

Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusAsyncApiTest.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
Comment thread temporal-sdk/src/test/java/io/temporal/client/nexus/NexusOperationHandleTest.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, assuming we address the cancel tests and any open SDK team discussions

@Evanthx Evanthx requested a review from GregoryTravis June 3, 2026 21:05
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClient.java
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusServiceClient.java Outdated
Comment thread temporal-sdk/src/main/java/io/temporal/client/NexusClientImpl.java Outdated
@Evanthx Evanthx requested a review from maciejdudko June 9, 2026 00:43
Comment on lines +108 to +110
public <T> NexusServiceClient<T> newNexusServiceClient(Class<T> service, String endpoint) {
enforceNonWorkflowThread();
return WorkflowThreadMarker.protectFromWorkflowThread(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newUntypedNexusServiceClient should call enforceNonWorkflowThread and protectFromWorkflowThread too.

Comment on lines 277 to 284
@Override
public ListNexusOperationExecutionsOutput listNexusOperationExecutions(
ListNexusOperationExecutionsInput input) {
// Pagination is an internal concern; the interceptor surface sees a single query in and a
// materialized list out. The loop bounds itself by the server-supplied next_page_token.
// stream of deserialized executions out. The loop bounds itself by the server-supplied
// next_page_token, accumulating all pages before streaming deserialized results.
java.util.List<io.temporal.api.nexus.v1.NexusOperationExecutionListInfo> all =
new java.util.ArrayList<>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation should lazily fetch pages as needed. You can use EagerPaginator to implement it (see how RootActivityClientInvoker.listActivities and ListActivityExecutionIterator use it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants